package com.jthinker.utils;

import java.util.HashMap;
import java.util.Map;

/**
 * User: Gang Chen
 * Date: 2015/3/19 15:00
 */
public abstract class CommonUtils
{
    public static Map<String, Object> getSuccessMessage(Object data)
    {
        return getSuccessMessage(null, data);
    }

    public static Map<String, Object> getSuccessMessage(String message)
    {
        return getSuccessMessage(message, null);
    }

    public static Map<String, Object> getSuccessMessage(String message, Object data)
    {
        return getMessage(false, message, data);
    }

    public static Map<String, Object> getMessage(boolean isError, String message, Object data)
    {
        Map<String, Object> map = new HashMap<String, Object>();
        map.put("isError", isError);
        map.put("message", message);
        map.put("data", data);
        return map;
    }
}
